package com.hsl.study.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: hsl
 * @CreateTime: 2025-02-14  20:42
 */
@RestController
@Slf4j
public class DemoController {
    @GetMapping("/demo/test/{id}")
    public Map<String, String> test(@PathVariable("id") Integer id)
    {
        log.info("业务：user.id: {}",id);
        Map<String, String> result = new HashMap<>(2);
        result.put("code", "200");
        int i  = 1;
//        i = i / 0;
        return result;
    }
}
